package com.rayo.accesscontrollercopy.model.db.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.litesuits.orm.db.annotation.Column;
import com.litesuits.orm.db.annotation.Ignore;
import com.litesuits.orm.db.annotation.Table;
import com.rayo.accesscontrollercopy.config.NetworkConfig;
import com.rayo.wallreader.utils.TimeUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by yanghaojie on 16/7/27.
 */
@Table("heart_table")
public class HeartData extends BaseModel {
    public static final String SITE = "site";
    public static final String LOCKID = "lockid";

    @Column(SITE)
    @JSONField(serialize = false)
    public String site;
    @Column(LOCKID)
    private String lockid;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date operator;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date timezone;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date calendar;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date dst;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date cardtime;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date blacklist;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date keyusertime;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date cardusertime;

    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date lockusertime;

    private String appversion;

    @Ignore
    private List<String> keylist;
    @Ignore
    private List<String> cardlist;
    @Ignore
    private int status;
    private Date lock;
     @Ignore
     List<String>locklist;

    private String timestamp;

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getServertimestamp() {
        return servertimestamp;
    }

    public void setServertimestamp(String servertimestamp) {
        this.servertimestamp = servertimestamp;
    }

    private String servertimestamp;

    public HeartData() {
        this.site = "0";
        this.lockid = "0";
        this.operator = TimeUtils.dateFromNotYMDHMS("010102010100");
        this.timezone = TimeUtils.dateFromNotYMDHMS("010102010100");
        this.calendar = TimeUtils.dateFromNotYMDHMS("0101020101");
        this.dst = TimeUtils.dateFromNotYMDHMS("010102010100");
        this.cardtime = TimeUtils.dateFromNotYMDHMS("010102010100");
        this.blacklist = TimeUtils.dateFromNotYMDHMS("010102010100");
        this.appversion = null;
        this.keylist = new ArrayList<>();
        this.cardlist = new ArrayList<>();
        this.locklist=new ArrayList<>();
        this.status = 0;
        this.lockusertime=TimeUtils.dateFromNotYMDHMS("010102010100");
    }

    public void updateDate(Date date) {
        this.setBlacklist(date);
        this.setOperator(date);
        this.setDst(date);
        this.setCardtime(date);
        this.setCalendar(date);
        this.setTimezone(date);
        this.setKeyusertime(date);
        this.setCardusertime(date);
        this.setLockusertime(date);
        this.setLock(date);
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    public String getLockid() {
        return lockid;
    }

    public void setLockid(String lockid) {
        this.lockid = lockid;
    }

    public Date getOperator() {
        return operator;
    }

    public void setOperator(Date operator) {
        this.operator = operator;
    }

    public Date getCalendar() {
        return calendar;
    }

    public void setCalendar(Date calendar) {
        this.calendar = calendar;
    }

    public Date getCardtime() {
        return cardtime;
    }

    public void setCardtime(Date cardtime) {
        this.cardtime = cardtime;
    }

    public Date getBlacklist() {
        return blacklist;
    }

    public void setBlacklist(Date blacklist) {
        this.blacklist = blacklist;
    }

    public Date getDst() {
        return dst;
    }

    public void setDst(Date dst) {
        this.dst = dst;
    }

    public Date getTimezone() {
        return timezone;
    }

    public void setTimezone(Date timezone) {
        this.timezone = timezone;
    }

    public String getAppversion() {
        return appversion;
    }

    public void setAppversion(String appversion) {
        this.appversion = appversion;
    }

    public List<String> getKeylist() {
        return keylist;
    }

    public void setKeylist(List<String> keylist) {
        this.keylist = keylist;
    }

    public List<String> getCardlist() {
        return cardlist;
    }

    public void setCardlist(List<String> cardlist) {
        this.cardlist = cardlist;
    }

    public List<String> getLocklist() {
        return locklist;
    }

    public void setLocklist(List<String> locklist) {
        this.locklist = locklist;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }


    public Date getKeyusertime() {
        return keyusertime;
    }

    public void setKeyusertime(Date keyusertime) {
        this.keyusertime = keyusertime;
    }

    public Date getCardusertime() {
        return cardusertime;
    }

    public void setCardusertime(Date cardusertime) {
        this.cardusertime = cardusertime;
    }

    public Date getLockusertime() {
        return lockusertime;
    }

    public void setLockusertime(Date lockusertime) {
        this.lockusertime = lockusertime;
    }

    public Date getLock() {
        return lock;
    }

    public void setLock(Date lock) {
        this.lock = lock;
    }

    @Override
    public String toString() {
        return "HeartData{" +
                "site='" + site + '\'' +
                ", lockid=" + lockid +
                ", operator=" + operator +
                ", timezone=" + timezone +
                ", calendar=" + calendar +
                ", dst=" + dst +
                ", cardtime=" + cardtime +
                ", blacklist=" + blacklist +
                ", version=" + appversion +
                '}';
    }


}
